Fix schema mismatches and auth for current Garmin Connect responses#22
Open
Shinnnyshinshin wants to merge 1 commit intoarathunku:mainfrom
Open
Fix schema mismatches and auth for current Garmin Connect responses#22Shinnnyshinshin wants to merge 1 commit intoarathunku:mainfrom
Shinnnyshinshin wants to merge 1 commit intoarathunku:mainfrom
Conversation
…rent Garmin API - Mark elevation_gain/loss as nullable in Activity and optional+nullable in ActivityList (absent for non-outdoor activities e.g. gym workouts) - Fix garminGUID field mapping in Profile (key was garminGUID not garmin_guid) - Mark full_name, activity_power_visibility, allow_golf_live_scoring as nullable in Profile (absent/null on some account types) - Mark description as optional+nullable in ActivityList - Fix cookie header serialization in auth — join list with "; " before setting header value - Move preferred_envs to cli/0 per current Mix API and bump credo to 1.7.11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix schema mismatches and auth for current Garmin Connect responses
These changes fix a set of issues that prevent the library from working out of the box when following
examples/basic.livemdwith a typical Garmin Connect account.Schema fixes
Profile (
api/profile.ex)garminGUID: the JSON key isgarminGUID, notgarmin_guid— the field was never being populated. Fixed with an explicit key alias.full_name,activity_power_visibility,allow_golf_live_scoring: marked as nullable, as these are absent or null on some account types.Activity and ActivityList (
api/activity.ex,api/activity_list.ex)elevation_gain/elevation_loss: marked asnullableinActivityandoptional + nullableinActivityList. These fields are absent for any non-outdoor activity (strength training, yoga, treadmill runs, etc.), causing a match error for anyone whose activity history isn't exclusively outdoor.descriptioninActivityList: marked asoptional + nullable— not all activities have a description.Auth fix (
auth.ex)get_cookie/1returns a list of cookie strings, butput_headerexpects a single string. This caused auth to fail silently by sending a malformed cookie header. Fixed by joining the list with"; "in bothsignin_req/2andsubmit_signin_req/3.Mix config (
mix.exs,mix.lock)preferred_cli_envinto thecli/0callback, which is the correct location in current Mix versions.credoto~> 1.7.11to resolve a dependency conflict.